using CustomORM.Examples.Entities;
using CustomORM.Mapping;

namespace CustomORM.Examples.MappingRepository
{
    class OrderMap : EntityToTableMapper<Order>
    {
        public OrderMap()
        {
            Table("Orders");
            Id(x => x.OrderID, "Order ID")
                .UseAssignedValue();
            Map(x => x.CustomerID, "Customer ID");
            Map(x => x.OrderDate, "Order Date");
            // cyclic dependencies not supported for now
            //References(x => x.Customer, "CustomerID");
            References(x => x.Employee, "Employee ID");
        }
    }
}